LR(1) Parser Generator Hyacc
نویسنده
چکیده
The space and time cost of LR parser generation is high. Robust and effective LR(1) parser generators are rare to find. This work employed the Knuth canonical algorithm, Pager’s practical general method, lane-tracing algorithm, and other relevant algorithms, implemented an efficient, practical and open-source parser generator Hyacc in ANSI C, which supports full LR(0)/LALR(1)/LR(1) and partial LR(k), and is compatible with Yacc and Bison in input format and command line user interface. In this paper we introduce Hyacc, and give a brief overview on its architecture, parse engine, storage table, precedence and associativity handling, error handling, data structures, performance and usage.
منابع مشابه
The Edge-Pushing LR(k) Algorithm
The original LR(k) parser generation algorithm of Knuth in 1965 is very expensive in time and space. Different approaches have been proposed to achieve LR(k) with better practical performance. This work designed a new LR(k) algorithm called the edge-pushing algorithm, which is based on recursively applying the lane-tracing process. The algorithm has been implemented into the parser generator Hy...
متن کاملAn Extension Of The Unit Production Elimination Algorithm
Removing unit productions from LR parsing machines can reduce the space and time cost of parsing. The unit production elimination algorithm of Pager may result in redundant states in the generated parsing machine. This work introduces an extension to remove the redundancy and thus minimize the parsing machine. We implemented the unit production elimination algorithm and its extension algorithm ...
متن کاملIncremental Generation of LR Parsers
Implementation of a new compiler usually requires making frequent adjustments to grammar de nitions. An incremental technique for updating the parser tables after a minor change to the grammar could potentially save much computational e ort. More importantly, debugging a grammar is made easier if the grammar is re-checked for correctness after each small change to the grammar. The basic design ...
متن کاملParameterized LR Parsing
Common LR parser generators lack abstraction facilities for defining recurring patterns of productions. Although there are generators capable of supporting regular expressions on the right hand side of productions, no generator supports user defined patterns in grammars. Parameterized LR parsing extends standard LR parsing technology by admitting grammars with parameterized non-terminal symbols...
متن کاملA Fast General Parser for Automatic Code Generation
The code generator in a compiler attempts to match a subject tree against a collection of tree-shaped patterns for generating instructions. Tree-pattern matching may be considered as a generalization of string parsing. We propose a new generalized LR (GLR) parser, which extends the LR parser stack with a parser cactus. GLR explores all plausible parsing steps to find the least-cost matching. GL...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008